<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
export default {
  mixins: [Vue.prototype.$vFN.Mixins.Base, Vue.prototype.$vFN.Mixins.Edit],
  components: {},
  data() {
    return {
      appWindow: window,

      form: {
        isAutoRelease: "0",
        templateId: ""
      },


      // 页面接口地址
      apiUrl: {
        update: "mall-site-portal/wechat-ma-audit/submitAudit"
      },
      
    };
  },
  methods: {
    // 初始化

    async init() {
      
      // 显示窗口
      this.mixinEdit_editVisible = true;
      this.mixinEdit_loading = false;
      // 默认选择
      this.form.templateId = this.isEditionList[0].templateId;
    },

    // 确定按钮
    determine(){

      // 修改参数
      let parameter = {
        isAutoRelease: this.form.isAutoRelease,
        templateId: Number(this.form.templateId)
      }

      this.submit(parameter)
    },

    // 提交审核
    async  submit(value){
      this.mixinEdit_loading = true;

      let _data = await this.$vFN.Http.post(
                {
                    url: this.apiUrl.update,
                    data: value,
                },
        window
      );

      this.mixinEdit_loading = false;

      if(_data._ok){
          // 成功回调
          this.onSuccess(_data);
          this.mixinEdit_editBoxClose("editForm");   
      }

    },


    // 取消回调
    onCancel() {},
    // 失败回调
    onError() {},
  },
  mounted() {
    this.init();
  },
  activated() {},
};
</script>
